home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / p / portfoli / uniforth / table.txt < prev    next >
Encoding:
Text File  |  1996-10-30  |  2.6 KB  |  60 lines

  1. ( If you want to use UniForth with the PortFolio, I'd recommend)
  2. ( forgetting the block editor and using the PortFolio's native text)
  3. ( editor.  Here is an example:)
  4.  
  5. ( create a text file, call it TABLE.TXT, that contains the) 
  6. ( following two lines-)
  7.  
  8. : TABLE CR 5 1 DO 5 1 DO I J * 4 .R LOOP CR LOOP ;
  9. ;S
  10.  
  11. ( the word TABLE will print a simple multiplication table when)
  12. ( executed in UniForth.  BE SURE TO END THE ACTUAL PROGRAM CODE)
  13. ( WITH A ";S" ON A LINE BY ITSELF, AND TO SET OFF ALL COMMENTS WITH)
  14. ( PARENTHESIS AS I'VE DONE IN THIS FILE.  Be sure to leave a space)
  15. ( between the 1st parenthesis and the start of the comment.)
  16.  
  17. ( Now start Uniforth by typing Uniforth.  You'll get a message) 
  18. ( that UniForth can't find it's default INIT file, but don't worry) 
  19. ( about it.  To load in the source code file TABLE.TXT type:)
  20.  
  21. ( OPEN TABLE.TXT ) ( open the file)
  22. ( FLOAD ) ( load the file)
  23.  
  24. ( --you should see Forth respond with an "ok".  Now you can type) 
  25. ( the word TABLE and see a multiplication table appear on the) 
  26. ( screen.  You can also type WORDS to see all the words in the) 
  27. ( dictionary.  TABLE should be the first one.)
  28.  
  29. ( An even faster way to load your source file into UniForth is to) 
  30. ( specify it on the DOS command line when you start UniForth.)_
  31. ( Type:)
  32.  
  33. ( UNIFORTH TABLE.TXT)
  34.  
  35. ( then after Forth loads and gives you an "ok", type:)
  36.  
  37. ( FLOAD)
  38.  
  39. ( to load the file.  You can automate the edit/compile cycle by)
  40. ( writing a batch file to automatically start Uniforth with a common)
  41. ( source file, perhaps "UNIFORTH SOURCE.TXT".  Do all of your source)
  42. ( code editing in the SOURCE.TXT file, then copy it to another name)
  43. ( for safekeeping when through programming. )
  44.  
  45. ( Another way to speed the edit/compile sequence is to use a small) 
  46. ( text editor like VDE, available on this forum as VDE140.ARC.)
  47. ( You can edit a source code file, save it, temporarily run a DOS)
  48. ( command like "UNIFORTH SOURCE.TXT", type FLOAD in Forth and run)
  49. ( your program.  If any error occurs while loading, UniForth will)
  50. ( tell you where and show you the offending line.  Then typing)
  51. ( "BYE" will drop you back into the editor again.  Sophisticated) 
  52. ( editors like VDE also allow you to set up macros, so you could)
  53. ( automate the whole sequence and tie it to a unique key)
  54. ( combination.)
  55.  
  56. ( Have fun with UniForth.  I've been unable to locate the firm)
  57. ( which produced it, so if you really get into Forth programming I'd)
  58. ( recommend a commercial product like LMI's PC Forth.  You can)
  59. ( contact LMI at 213-306-7412, or through their BBS at 213-306-3530,)
  60. ( or via CompuServe Email at LMI 72406,1577. <STS>)